module.exports = {
  publicPath: "/my-store/",
  chainWebpack: config => {
    const oneOfsMap = config.module.rule("scss").oneOfs.store;
    oneOfsMap.forEach(item => {
      item
        .use("sass-resources-loader")
        .loader("sass-resources-loader")
        .options({
          resources: "./src/css/common.scss"
      })
    });
  },
  devServer: {
    host: "0.0.0.0", // 地址
    port: 8080, // 端口
    hot: true, // 模板热替换
    open: true, // 自动打开浏览器
    compress: true, // 一切服务都启用 gzip 压缩
    https: false, // 是否启用HTTPS协议
    proxy: {
      "/api": {
        target: "http://192.168.0.102:3000",
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/api": ""
        }
      },
      "/test": {
        target: "http://192.168.0.105:3003",
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          "^/test": ""
        }
      }
    }
  }
};
